package com.rainng.coursesystem.controller.teacher;

import com.rainng.coursesystem.config.themis.annotation.Teacher;
import com.rainng.coursesystem.model.vo.response.ResultVO;
import com.rainng.coursesystem.service.BaseService;
import com.rainng.coursesystem.service.teacher.VodService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@Teacher
@RequestMapping("/teacher/courseResource")
@RestController
@Api(value = "阿里云上传视频及文件")
public class VodController {

    @Autowired
    private VodService vodService;

    @ApiOperation(value = "老师上传视频")
    @PostMapping("/upload")
    public ResultVO vodUpload(MultipartFile file) {
        return vodService.vodUpload(file);
    }


    @ApiOperation(value = "获取播放凭证")
    @GetMapping
    public ResultVO getAuth(String vid){
        return vodService.getAuth(vid);
    }

//
//    @ApiOperation(value = "文件上传")
//    @PostMapping("{courseId}")
//    public ResultVO fileUpLoad(@PathVariable Integer courseId,@RequestParam("file") MultipartFile file){
//        return vodService.fileUpLoad(courseId,file);
//    }
}
